package csu.rjxyg.action.infoAction;

import java.util.List;

import csu.rjxyg.action.BaseAction;
import csu.rjxyg.action.constant.UserConstant;
import csu.rjxyg.bean.core.BaseList;
import csu.rjxyg.bean.core.BaseObject;
import csu.rjxyg.factory.core.UtilFactory;
import csu.rjxyg.service.BaseInfoService;
import csu.rjxyg.util.LogUtil;

public class ChangeInfoStatus extends BaseAction {
	private LogUtil log;	
	private String[] inInfoIdList;
	
	public ChangeInfoStatus(){
		log = UtilFactory.getLogUtil(this.getClass());
	}
	
	public void readInfo(){
		String name = null;
		try{
			
			BaseObject object = (BaseObject) this.getSession().get(UserConstant.USER_SESSION);
			name = (String) object.get(UserConstant.USER_ID);
			BaseInfoService infoService = (BaseInfoService) factory.getBean(BaseAction.INFO_SERVICE);
			if( infoService.changeInfoStatus(inInfoIdList, "已读") ){
				log.info(name + "标记信息为已读成功");
				this.out("success");
				return;
			}
			this.out("error");
		}catch(Exception e){
			log.info(name + "标记信息为已读失败");
			e.printStackTrace();
			log.info(e.getMessage());
			
		}
	}


	public String[] getInInfoIdList() {
		return inInfoIdList;
	}

	public void setInInfoIdList(String[] inInfoIdList) {
		this.inInfoIdList = inInfoIdList;
	}
	
	
}
